<?php
//require_once 'storage/AMStorage.php';
require_once 'storage/CMdb.php';

class MPDOStorage /*extends AMStorage*/ {
	
	private static $conn;
	
	private function __construct(){
		//parent::__construct(CMdb::DSN_MAIN);
	}

	public static function instance($dsn = ''){
		
		if(self::$conn === null):
			if(!$dsn)
				$dsn = CMdb::DSN_MAIN;
			
			try{
				self::$conn = new PDO($dsn);
			} catch (PDOException $po){
				echo $po;
			} catch (Exception $e){
				echo $e;
			}
		endif;
		
		return self::$conn;
	}

	public function connect($dsn = null){}

	public function add(){}
	public function update(){}
	public function remove(){}

	public function __clone(){
		throw new MException('This class can not be cloned');
	}
}
?>